package springcloudDemo;

import springcloudDemo.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ConsumerController {

    @Autowired
    private IFeignService feignService;

    @GetMapping(value = "feign")
    public String index() {
        return "feign" + "==" + feignService.indexService();
    }

    @GetMapping(value = "/feign-consumer")
    public String helloConsumer() {
        StringBuilder sb = new StringBuilder();
        sb.append(feignService.hello("DIDI")).append("\n");
        sb.append(feignService.hello("DIDI",30)).append("\n");
        sb.append(feignService.hello(new User("DIDI", 30))).append("\n");
        return sb.toString();
    }
}
